import http from './http.js'

let openId = uni.getStorageSync('openId')|| getApp().globalData.openId
// 查询公司
export const getBusinessProductCompany =() =>{
	return http.get('/Business/ProductCompany')
}
// 获取轮播图 @params type:1:首页 2：数据页 3：公司数据页;companyId:公司id
export const getBusinessCarousel =(params) =>{
	return http.get('/Business/Carousel',params)
}
// 获取公司行情列表
export const getBusinessDataMenu =(params) =>{
	return http.get('/Business/DataMenu',params)
}
//获取openid
export const getUserExistCode =(params) =>{
	console.log(params)
	return http.get('/User/ExistCode',params)
}
//获取手机号
export const postVisitPhone =(params) =>{
	return http.post('/User/VisitPhone',params)
}

// 获取首页
export const getQuoteHome =(params) =>{
	return http.get('/Quote/Home',params)
}
// 获取行情数据
export const getQuoteData =(params) =>{
	return http.get('/Quote/Data',params)
}
// 获取库存列表
export const getQuoteStock =(params) =>{
	return http.get('/Quote/Stock',params)
}
// 生成订单
export const postOrderGenerate =(params) =>{
	console.log('openId',openId)
	return http.post(`/Order/Generate?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`,params)
}
// 提交订单
export const postOrderSubmit =(params) =>{
	return http.post(`/Order/Submit?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`,params)
}
// 取消订单
export const putOrderCancel =(params) =>{
	return http.put(`/Order/Cancel?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}&orderId=${params.orderId}`,params)
}
// 订单详情
export const postOrderDetail =(params) =>{
	return http.post(`/Order/Detail?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}&orderId=${params.orderId}`)
}
// 订单列表
export const getOrderDetail =(params) =>{
	return http.get(`/Order/List?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`,params)
}

// 获取手机号码
export const getHomeMy =() =>{
	return http.get(`/Home/My?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`)
}
// 退出登录
export const putUserSignOut =() =>{
	return http.put(`/User/SignOut?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`)
}

// 编辑信息
export const postUserSetUserInfo =(params) =>{
	console.log(44)
	return http.post(`/User/SetUserInfo?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`,params)
}
